//
//  WeiboDemoViewController.swift
//  微博
//
//  Created by LH on 2017/5/24.
//  Copyright © 2017年 LH. All rights reserved.
//

import UIKit

class WeiboDemoViewController: WeiboBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第 \(String(describing: navigationController?.childViewControllers.count ?? 0)) 个"
        // Do any additional setup after loading the view.
    }

    @objc fileprivate func showNext(){
        let vc = WeiboDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
        
    }
}
extension WeiboDemoViewController{
    override func setupUI(){
        super.setupUI()
        
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext) )
        //第二种方法
//        let but : UIButton = UIButton.cz_textButton("下一个", fontSize: 18, normalColor: UIColor.white, highlightedColor: UIColor.orange)
//        but.addTarget(self, action: #selector(showNext), for: UIControlEvents.touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: but)
        //第三种 扩展 遍历构造函数
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", fontSize: 15, target: self, action: #selector(showNext))
    }
}
